﻿<UserControl x:Class="PairingMatrix.View.CardWallControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:View="clr-namespace:PairingMatrix.View" xmlns:Converter="clr-namespace:PairingMatrix.View.Converter" mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="1000" d:DataContext="{Binding Source={StaticResource CardWall}}">

	<UserControl.Resources>
		<Converter:DevelopmentStageToOpacityConverter x:Key="developmentStageToOpacityConverter" />
		<Converter:BoolToVisibilityConverter x:Key="boolToVisibilityConverter" />
	</UserControl.Resources>
	<Grid x:Name="LayoutRoot" Background="White">
		<View:ToolBarControl HorizontalAlignment="Left" VerticalAlignment="Top" DataContext="{Binding Path=ToolBarViewModel}" />
		<View:TabsControl HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,5,0,0" />
        <TextBlock Text="{Binding Path=DaysToIterationEnd}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,13,170,0" FontSize="18" FontFamily="Fonts/Fonts.zip#Consolas" Foreground="Brown"/>
        <View:TimerControl HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,100,0" DataContext="{Binding Path=TimerViewModel}" />
        <Grid x:Name="iceCreamMeterBox" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,100,0,0" Visibility="{Binding Path=ShowIceCreamMeter, Converter={StaticResource boolToVisibilityConverter}}">
            <Rectangle Height="450" Width="230" Fill="AliceBlue" RadiusX="10" RadiusY="10"  />
            <TextBlock Text="Total Amount: " Margin="10,10,0,0" Height="30"  HorizontalAlignment="Left" VerticalAlignment="Top"/>
            <TextBox x:Name="totalAmont" Text="{Binding Path=TotalCostOfIceCreams, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="100,10,0,0" Height="30" Width="110" HorizontalAlignment="Left" VerticalAlignment="Top"/>
            <TextBox x:Name="defaultersList" Text="{Binding Path=IceCreamsDefaulterList}" AcceptsReturn="True" Margin="10,50,0,0" Height="300" Width="200" HorizontalAlignment="Left" VerticalAlignment="Top"/>
            <Button Content="Clear Ice cream bars" Margin="10,380,0,0" Height="30" Width="200" HorizontalAlignment="Left" VerticalAlignment="Top" Command="{Binding Path=ClearIceCreamsCommand}"/>
        </Grid>
		<StackPanel Orientation="Horizontal" Margin="0,60,0,0" Visibility="{Binding Path=ShowCardWall, Converter={StaticResource boolToVisibilityConverter}}">
			<Grid>
				<StackPanel>
					<Grid>
						<Rectangle x:Name="ReadyForDev" Height="500" Width="360" Fill="LightGray" RadiusX="10" RadiusY="10" Opacity="{Binding Path=SelectedStoryStatus, Converter={StaticResource developmentStageToOpacityConverter}, ConverterParameter=ReadyForDev}" />
						<TextBlock Text="Ready for Dev" Style="{StaticResource CardPartitionText}" />
						<View:PriorityCounterControl DataContext="{Binding Path=ReadyForDevPriorityCounter}" VerticalAlignment="Top" Margin="0,50,0,0" />
					</Grid>
				</StackPanel>
			</Grid>
			<Rectangle Height="1000" Width="1" Stroke="LightGray" />
			<Grid>
				<Rectangle x:Name="InDev" Height="1000" Width="360" Fill="LightGray" RadiusX="10" RadiusY="10" Opacity="{Binding Path=SelectedStoryStatus, Converter={StaticResource developmentStageToOpacityConverter}, ConverterParameter=InDev}" />
				<TextBlock Text="In Dev" Style="{StaticResource CardPartitionText}" />
				<View:PriorityCounterControl DataContext="{Binding Path=InDevPriorityCounter}" VerticalAlignment="Top" Margin="0,50,0,0" />
			</Grid>
			<Rectangle Height="1000" Width="1" Stroke="LightGray" />
			<Grid>
				<Rectangle x:Name="InQA" Height="1000" Width="360" Fill="LightGray" RadiusX="10" RadiusY="10" Opacity="{Binding Path=SelectedStoryStatus, Converter={StaticResource developmentStageToOpacityConverter}, ConverterParameter=InQA}" />
				<TextBlock Text="In QA (and Before Showcase)" Style="{StaticResource CardPartitionText}" />
				<View:PriorityCounterControl DataContext="{Binding Path=InQAPriorityCounter}" VerticalAlignment="Top" Margin="0,50,0,0" />
			</Grid>
			<Rectangle Height="1000" Width="1" Stroke="LightGray" />
			<Grid>
				<Rectangle x:Name="ReadyForRegressionTesting" Height="1000" Width="360" Fill="LightGray" RadiusX="10" RadiusY="10" Opacity="{Binding Path=SelectedStoryStatus, Converter={StaticResource developmentStageToOpacityConverter}, ConverterParameter=ReadyForRegressionTesting}" />
				<TextBlock Text="Showcase Done" Style="{StaticResource CardPartitionText}" />
				<View:PriorityCounterControl DataContext="{Binding Path=ShowcaseDonePriorityCounter}" VerticalAlignment="Top" Margin="0,50,0,0" />
			</Grid>
			<Rectangle Height="1000" Width="1" Stroke="LightGray" />
			<Grid>
				<Rectangle x:Name="Closed" Height="1000" Width="360" Fill="LightGray" RadiusX="10" RadiusY="10" Opacity="{Binding Path=SelectedStoryStatus, Converter={StaticResource developmentStageToOpacityConverter}, ConverterParameter=Closed}" />
				<TextBlock Text="Closed/Deleted" Style="{StaticResource CardPartitionText}" />
				<View:PriorityCounterControl DataContext="{Binding Path=ClosedPriorityCounter}" VerticalAlignment="Top" Margin="0,50,0,0" />
			</Grid>
		</StackPanel>

        <View:DateStripControl Margin="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" DataContext="{Binding EndDateStrip}" >
            <View:DateStripControl.RenderTransform>
                <ScaleTransform ScaleX="0.7" ScaleY="0.7"/>
            </View:DateStripControl.RenderTransform>
        </View:DateStripControl>

        <ItemsControl x:Name="ProjectCards" ItemsSource="{Binding Path=ProjectCards}">
			<ItemsControl.ItemTemplate>
				<DataTemplate>
					<View:ProjectCardControl />
				</DataTemplate>
			</ItemsControl.ItemTemplate>
			<ItemsControl.ItemsPanel>
				<ItemsPanelTemplate>
					<Canvas Height="2000" Width="2000" />
				</ItemsPanelTemplate>
			</ItemsControl.ItemsPanel>
		</ItemsControl>

        <View:AbsenteesBoxControl DataContext="{Binding Path=AbsenteesViewModel}" Margin="0,0,0,10" HorizontalAlignment="Left" VerticalAlignment="Bottom" Opacity="1"/>

        <ItemsControl ItemsSource="{Binding Path=TeamMembers}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <View:TeamMemberCardControl />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <Canvas Height="2000" Width="2000" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
        </ItemsControl>

        <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Width="400" Height="100" Visibility="{Binding Path=IsWallEmpty, Converter={StaticResource boolToVisibilityConverter}}" Background="#FF60C19E" Opacity="0.8">
			<TextBlock Text="The Wall is empty. Do you want to copy contents from previous day?" Margin="20" TextWrapping="Wrap" />
			<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,10">
				<Button Content="Copy" Command="{Binding Path=CopyWallCommand}" Height="30" Width="100" />
				<Button Content="Cancel" Command="{Binding Path=CancelCopyWallCommand}" Height="30" Width="100" />
			</StackPanel>
		</Grid>

        
<!--		<Grid Visibility="{Binding Path=ShowMingleCards, Converter={StaticResource boolToVisibilityConverter}}">-->
<!--			<Rectangle Fill="#FFFF8200" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="50" RadiusX="40" RadiusY="40" />-->
<!--			<Rectangle Fill="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="70,100,70,70" RadiusX="40" RadiusY="40" />-->
<!--			<TextBlock Text="Loading cards from Mingle..." Margin="70,70,70,70" FontSize="18" FontFamily="Fonts/Fonts.zip#Consolas" />-->
<!--			<TextBlock Text="Ready For Dev" Margin="100,120,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="17" FontFamily="Fonts/Fonts.zip#Consolas" />-->
<!--			<TextBlock Text="In Dev" Margin="650,120,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="17" FontFamily="Fonts/Fonts.zip#Consolas" />-->
<!--			<TextBlock Text="In QA" Margin="1200,120,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="17" FontFamily="Fonts/Fonts.zip#Consolas" />-->
			<!--            <TextBlock Text="Showcase Complete" Margin="1300,120,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="17" FontFamily="Fonts/Fonts.zip#Consolas"/>-->
			<!--            <TextBlock Text="Closed" Margin="1700,120,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="17" FontFamily="Fonts/Fonts.zip#Consolas"/>-->
<!--			<ItemsControl x:Name="MingleCards" ItemsSource="{Binding Path=MingleCards}" Margin="20" HorizontalAlignment="Left" VerticalAlignment="Top">-->
<!--				<ItemsControl.ItemTemplate>-->
<!--					<DataTemplate>-->
<!--						<View:MingleCardControl Margin="0,10,10,10" />-->
<!--					</DataTemplate>-->
<!--				</ItemsControl.ItemTemplate>-->
<!--				<ItemsControl.ItemsPanel>-->
<!--					<ItemsPanelTemplate>-->
<!--						<Canvas Height="2000" Width="2000" />-->
<!--					</ItemsPanelTemplate>-->
<!--				</ItemsControl.ItemsPanel>-->
<!--			</ItemsControl>-->
<!---->
<!--		</Grid>-->

		<Grid Visibility="{Binding Path=ShowSettings, Converter={StaticResource boolToVisibilityConverter}}" Margin="250,80,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
			<View:SettingsControl DataContext="{Binding Path=SettingsViewModel}" />
		</Grid>

		<TextBlock Text="Recommended Pairing" Margin="530,350,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Normal" FontFamily="Fonts/Fonts.zip#Consolas" FontSize="16" TextAlignment="Center" Visibility="{Binding Path=ShowPairingMatrix, Converter={StaticResource boolToVisibilityConverter}}" />
		<TextBlock Text="Avoid Pairing" Margin="530,470,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Normal" FontFamily="Fonts/Fonts.zip#Consolas" FontSize="16" TextAlignment="Center" Visibility="{Binding Path=ShowPairingMatrix, Converter={StaticResource boolToVisibilityConverter}}" />
		<TextBlock Text="Project Card Assignments" Margin="530,600,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Normal" FontFamily="Fonts/Fonts.zip#Consolas" FontSize="16" TextAlignment="Center" Visibility="{Binding Path=ShowPairingMatrix, Converter={StaticResource boolToVisibilityConverter}}" />
    

    </Grid>
</UserControl>
